#ifndef __CAUBuilder_H__
#define __CAUBuilder_H__
#include "IAUBuilder.h"
#include "IPESBuilder.h"
#include "CDynamicArray.h"
#include <vector>

/**
This class recieves the audio and video PES lists and extracts the relevant AUs
out of those PESs and puts them into the audio/video AU list. 
*/
class CAUBuilder : public IAUBuilder
{
public:
	/**
	c'tor.
	@param nAudioPID - the PID of the audio stream
	@param nVideoPID - the PID of the video stream
	*/
	CAUBuilder(unsigned int nAudioPID, unsigned int nVideoPID);
	/**
	d'tor.
	deletes all the AU lists
	*/
	virtual ~CAUBuilder(void);
	/**
	takes PESs from the Audio and Video pes lists extracts AU's
	from these PESs and puts them to audio and video AU lists .
	@param cPesBuilder- the CPESBuilder class that holds PESs list
	*/
    void BuildAu(IPESBuilder* cPesBuilder);


private: 
	/* iterates over the audio PES list and extracts the AU's out of them and puts the AU's into the Audio AU list.*/
	void _buildAudioAu(IPESBuilder* cPesBuilder);
	/* iterates over the video PES list and extracts the AU's out of them and puts the AU's into the Video AU list.*/
	void _buildVideoAu(IPESBuilder* cPesBuilder);

	unsigned int m_nAudioPID;
	unsigned int m_nVideoPID;

};

#endif //__CAUBuilder_H__
